<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../../../css/mui.min.css">
		<link rel="stylesheet" href="../css/common.css">
		<title>选择外来单位</title>
		<style>
			html,body,.mui-content{background:#fff;}
			.mui-search{width: 82%;margin:10px;}
			.p-search{display: flex;font-size: 14px;background-color:rgba(244, 244, 244, 1);height:54px;
			}
			.p-search input{background:#fff;}.mui-search::before{margin:-10px 0 0;}
			.p-search a{color:#09BB07;line-height:54px;height:54px;}.p-list{display: flex;}
			.job{font-size: 13px;color: #fff;background:rgb(15, 169, 244);
			width:60px;height:60px; text-align: center;line-height: 60px;border-radius: 50%;}
			.detail{border-bottom: 1px solid #eee;width: 100%;padding: 0 0 3px 10px;display: flex;flex-wrap: wrap;}.detail span{display: block;line-height: 30px;}
			.detail .a1,.detail .a3{width:60%}.detail .a1{font-size: 17px;}.detail .a2{color: #333;font-size: 13px;}
			.detail .a3{width: 98%;}
			.detail .a2,.detail .a4{width:98%;text-align: left;}.detail .a3{font-size: 14px;color: #333;}.detail .a4{color: #008FE0;font-size: 12px;}
			.p-list{padding:10px 10px 0 10px;background:#fff;}.more{position: fixed;right:5%;bottom:10%;}
			.mui-bar{-webkit-box-shadow: 0 1px 6px rgba(244, 244, 244, 1);}
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">选择单位</h1>
		</header>
		<div class="mui-content" id="page" v-cloak>
			<div class="mui-row p-search">
				<div class="mui-input-row mui-search">
					<input adjust-position="false" type="search" v-model="form.enterpriseName" class="mui-input-clear" placeholder="请输入公司名称">
				</div>
				<a class="mui-navigate-left" @click="search">搜索</a>
			</div>
			
			<div class="mui-row p-list" v-for="(item,index) in list" :key="index">
				
				<div class="detail" @click="select(item)">
					<span class="a3">{{item.enterpriseName}}</span>
					<span class="a4"><font color="#555555">企业社会信用代码：</font>{{item.unifiedSocialCreditCode}}</span>
				</div>

			</div>	
		</div>
		<script src="../../../js/mui.min.js"></script>
		<script type="text/javascript" src="../../../js/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="../../../js/vue.js"></script>
		<script src="../js/mkeyplus.base.js"></script>
		<script src="../formal/js/api.js"></script>
		<script>
			mui.init()
			mui.plusReady(function(){
				//页面加载完成
				$('.mui-icon-clear').on('tap',function(){
					page.clear()
				})
				
				//page.pload()
			});
			var htapi = new HTGlobal();
			var page = new Vue({
				el:'#page',
				created(){
					//this.pload()
				},
				methods:{
					pload(){
						var _t = this;
						htapi.apiUrl[htapi.apiKey].temporary = htapi.apiUrl[htapi.apiKey].searchEnterprise+'?enterpriseName='+_t.form.enterpriseName;
						htapi.fetch({},function(data){
							if(data.code=='0'){
								_t.list = data.data;
							}
						},'查询中','temporary')
						delete htapi.apiUrl[htapi.apiKey].temporary;
					},
					select(rw){
						var fromPage = plus.webview.currentWebview().opener();
						mui.fire(fromPage, 'projectUnit',{enterpriseId:rw.id,enterpriseName:rw.enterpriseName});
						plus.webview.currentWebview().close();
					},
					search(){
						var keyword = this.form.enterpriseName;
						
						this.pload()
					
					},
					clear(){
						this.form.enterpriseName=''
					}
				},
				data:{
					form:{
						enterpriseName:''
					},
					list:[]
				}
			})
		</script>
	</body>
</html>
